Health Cloud Financial System API - Implementation Template
Developer guide
Financial Dev Guide
The US-Core Financial application uses the following DataWeave modules to map between HealthCloud and FHIR formats.
| Module | Description |
|---|---|
| CoverageEligibilityResponseLib | This module defines functions needed to convert a FHIR CoverageEligibilityResponse resource into it's representation within Health Cloud. |
| Util | A library with needed dataweave utility functions. |
CoverageEligibilityResponseLib
This module defines functions needed to convert a
FHIR CoverageEligibilityResponse resource into it's representation
within Health Cloud.
Source:
.src/main/resources/dw/CoverageEligibilityResponseLib.dwl
Functions
fun getResultIds (res)
This function takes the results of a Salesforce query and returns a list of IDs.
param
resis a Salesforce query result.
return An array with a list of Ids found.
fun getMemberPlan (fhirObj)
Converts the provided CoverageEligibilityResponse FHIR object to the HealthCloud MemberPlan object.
param
fhirObjis a FHIR CoverageEligibilityResponse object.
return A HealthCloud MemberPlan object.
fun getCoverageBenefits (insurance, memberPlanId, memberId)
Converts the provided CoverageEligibilityResponse insurance object to a list of HealthCloud CoverageBenefit objects.
param
insuranceis a FHIR CoverageEligibilityResponse insurance object.
parammemberPlanIdis a string with the MemberPlan id.
parammemberIdis a string with the member Account Id.
return A list of HealthCloud CoverageBenefit objects.
fun getCoverageBenefitImpl (name, items, memberPlanId, memberId, benefitPeriod)
Converts the provided CoverageEligibilityResponse insurance object to a list of HealthCloud CoverageBenefit objects. This is the implementation function that's called by getCoverageBenefit. This implementation requires Salesforce version 52.
param
nameis the
paramitemsis a FHIR CoverageEligibilityResponse insurance item list.
parammemberPlanIdis a string with the MemberPlan id.
parammemberIdis a string with the member Account Id.
parambenefitPeriodis a Period object.
return A list of HealthCloud CoverageBenefit objects.
fun mapCoverageType (item)
Maps the coverage type with the provided item.
param
itemis the item to map.
return A string with the HealthCloud value or Undefined if not found.
fun allowedCategory (item)
Checks to see if the provided item is one of the supported valuse.
param
itemis a CoverageEligibilityResponse item object.
return A boolean with true if supported and false if not.
fun getCoverageBenefitsImpl (insurance, memberPlanId, memberId)
Gets the CoveargeBenefit objects with the provided FHIR insurance list and memberPlanId.
param
insuranceis a list of FHIR insurance objects.
parammemberPlanIdis a string with the member plan Id.
parammemberIdis a string with the member Account Id.
return a list of HealthCloud CoverageBenefit objects.
fun groupItems (insuranceItem)
Groups insurance items by name.
param
insuranceItemis the insurance item to group.
return A list of grouped insurance items with benefitPeriod set.
fun getCoverage (memberPlan, coverageBenefits)
Converts the provided HC MemberPlan and any CoverageBenefit objects into a FHIR CoverageEligibilityResponse object.
param
memberPlanis a HC MemberPlan object.
paramcoverageBenefitsis a list of HC CoverageBenefit objects.
return A FHIR formatted CoverageEligibilityResponse object.
fun getCategory (CoverageType)
Gets the category code with the provided SF CoverageType.
param
CoverageTypeis a String with 'Medical', 'Dental', or 'Vision'.
return The FHIR code for the category.
fun getLinkSelf (attr: Object)
Gets the URL to the current web resource.
param
attris an object with the attributes.
return A string with the self link.
fun getEntryUrl (item: Object, attr: Object)
Gets the URL for the entry provided.
param
itemis an object with the item that's being returned.
paramattris an object with the attributes.
return A string with the entry URL.
Util
A library with needed dataweave utility functions.
Source:
.src/main/resources/dw/Util.dwl
Functions
fun clean (obj: Object)
Cleans the provided object of blank strings, null values, empty objects, and empty arrays.
param
objis an Object to clean.
return A cleaned object.
fun clean (arr: Array)
Cleans the provided array of blank strings, null values, empty objects, and empty arrays.
param
arris an Array to clean.
return A cleaned Array.
fun removeNull (arr: Array)
Removes all null items from an array.
param
arris an array.
return An array with null items removed.
fun removeNull (obj: Object)
Removes all null values from an object.
param
objis an object.
return An object with null values removed.
fun matchReferenceReference (resource: String, ref: String)
Matches a standard reference and returns the ID portion.
param
resourceis a String with the resource to match. (ie Location)
paramrefis the reference String to match in.
return The matched ID or null if not found.
fun matchReferenceUrl (resource: String, ref: String)
Matches a URL reference and returns the ID portion.
param
resourceis a String with the resource to match. (ie Location)
paramrefis the reference String to match in.
return The matched ID or null if not found.
fun matchReference (resource: String, ref: String)
Matches any reference and returns the ID portion.
param
resourceis a String with the resource to match. (ie Location)
paramrefis the reference String to match in.
return The matched ID or null if not found.
fun hasReference (resource: String, ref: String)
Checks to see if the reference exists in the provide ref String with the provided resource String name.
param
resourceis a String with the resource to match. (ie Location)
paramrefis the reference String to match in.
return True if found and false if not.
fun getReferenceId (fhirObj, objName: String, refName: String)
This function a FHIR object and gets the reference value for the provided refName.
param
fhirObjis a FHIR object to search.
paramrefNameis a String with the reference name to match on. (Location, Practitioner ...)
return An array of reference Ids.
fun getReferenceListId (fhirObj, objName: String, refName: String)
This function a FHIR object and gets the reference value for the provided refName.
param
fhirObjis a FHIR object to search.
paramrefNameis a String with the reference name to match on. (Location, Practitioner ...)
return An array of reference Ids.
fun removeGeneratedIds (data)
Removed any generated IDs such as GUIDS from the payload for testing purposes.
param
datais FHIR bundle with the data to remove IDs from.
return The FHIR bundle with generated IDs removed.
fun removeAllInstances (data, fieldNames: Array)
Recursivly removes all instances of the provided fieldName within the provided data structure.
param
datais an array or object to remove the field from.
paramfieldNamesis a array of strings with the field names to remove.
return The data with the field removed.